package maven_Txl.maven_txl;

import java.io.BufferedWriter;
import java.io.IOException;
import java.io.Serializable;

/**
 * 设置Student的一些属性，方便后面的定义
 * @author GG
 *
 */
public class Student {

/*public class Student implements Serializable{
	static int i;
	static int j = 0;
	static int k = 0;
	static int num = 0;//程序计数器
	
	private static final long serialVersionUID = 1L;*/
	private String name;
	private String sex;
	private String add;
	private String tel;
	private String email;
	
	public Student() {
		super();
		// TODO Auto-generated constructor stub
	}

	public Student(String name, String sex, String add, String tel, String email) {
		super();
		this.name = name;
		this.sex = sex;
		this.add = add;
		this.tel = tel;
		this.email = email;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public String getAdd() {
		return add;
	}

	public void setAdd(String add) {
		this.add = add;
	}

	public String getTel() {
		return tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	/*@Override
	public String toString() {
		return "Student [name=" + name + ", sex=" + sex + ", add=" + add
				+ ", tel=" + tel + ", email=" + email + "]";*/
	
	public void save(BufferedWriter bw){
		try {
			bw.write(this.name+" "+this.sex+" "+this.add+" "+this.tel+" "+this.email );
			bw.newLine();
		} catch (IOException e) {
			// TODO: handle exception
			System.out.print("Wrong!");
			e.printStackTrace();
		}
	}
	
	public Student updateStu(){
		return new Student(this.name,this.sex,this.add,this.tel,this.email);
	}
	
}
